package com.caiyouxi.common.exception;

/**
 * 接口返回状态
 * weichangyong
 *
 * @create 2017-08-31 16:19
 **/
public enum ErrorCode {

    /*==========系统级别================*/
    // -1为通用失败（根据ApiResult.java中的构造方法注释而来）
    SYS_FAIL("SYS_ERROR", "系统异常"),
    //系统维护中
    SYS_ORDER_FAIL("SYS_ORDER_FAIL", "系统维护中"),
    // 0为成功
    SUCCESS("SUCCESS", "处理成功"),

    SYS_PARAMTER_MISSING("SYS_PARAMTER_MISSING", "缺少必要的参数"),

    SYS_API_NOT_FOUND("SYS_API_NOT_FOUND", "请求的接口不存在"),
    SYS_BUSSINESS_ERROR("SYS_BUSSINESS_ERROR", "业务处理失败"),
    SYS_OBJECT_NOT_FOUND("SYS_OBJECT_NOT_FOUND", "请求的对象不存在"),
    SYS_SERVICE_UNAVAILABLE("SYS_SERVICE_UNAVAILABLE", "服务不可用"),
    SYS_BUSY("SYS_BUSY", "无效的参数值(期望的是%s，实际为%x)"),
    SYS_JOB_EXPIRED("SYS_JOB_EXPIRED", "当前接口不支持请求的 HTTP METHOD ，请检查是否选择了正确的 POST/GET 请求方式。"),
    SYS_ILLEGAL_REQUEST("SYS_ILLEGAL_REQUEST", "非法的请求"),
    SYS_PERMISSION_DENIED("SYS_PERMISSION_DENIED", "该资源需要拥有授权才能调用"),
    SYS_APPID_INVALID("SYS_APPID_INVALID", "调用者提供的 app_id 参数无效"),
    SYS_IP_LIMIT("SYS_IP_LIMIT", "请求方所处的 IP 不允许访问该资源"),
    /*===================================订单相关================*/
    ORDER_NOT_FOUND("ORDER_NOT_FOUND", "订单不存在"),
    ORDER_STATUS_ERROR("ORDER_STATUS_ERROR", "订单状态不允许当前操作"),
    ORDER_CODE_ERROR("ORDER_CODE_ERROR", "订单货币类型不正确"),


    /*===================================SDKAPI支付相关================*/
    SDK_OBJECT_NOT_FOUND("SDK_APP_NOT_FOUND", "请求的对象不存在"),
    SDK_OBJECT_STATUS_ERROR("SDK_OBJECT_STATUS_ERROR", "请求的对象状态不可用"),
    SDK_ISCRIPT_NOT_FOUND("SDK_ISCRIPT_NOT_FOUND", "SDK IScript不存在"),
    SDK_VERIFY_FAILD("SDK_VERIFY_FAILD", "SDK 检验失败"),
    PAY_INVALID("PAY_INVALID", "支付方式无效"),
    SDK_TOKEN_ERROR("SDK_TOKEN_ERROR","token错误 "),
    SDK_TOKEN_EXPIRE("PAY_THIRD_FAILED","toekn过期"),
    PAY_THIRD_FAILED("PAY_THIRD_FAILED","第三方下单失败!"),
    PAY_ERROR_BALLANCE_LOW("PAY_ERROR_BALLANCE_LOW","余额不足"),

    /*===========================UserProfile ====================================*/
    USER_NOT_FOUND("USER_NOT_FOUND","用户不存在"),
    USER_FOUND("USER_FOUND","用户已存在"),
    USER_NAME_FOUND("USER_FOUND","用户名已存在"),
    USER_USERNAME_PASSWORD_ERROR ("USER_USERNAME_PASSWORD_ERROR", "用户名或密码错误"),
    USER_PASSWORD_MISSING ("USER_PASSWORD_MISSING", "密码缺失"),
    USER_USERNAME_MISSING ("USER_USERNAME_MISSING", "用户名缺失"),
    USER_TIME_OUT("USER_TIME_OUT","用户登陆失效"),
    USER_LOGIN_FORBID("USER_LOGIN_FORBID","该用户已被禁止登陆"),
    PHONE_IS_BINDING("PHONE_IS_BIND","该手机号码已绑定"),
    EMAIL_IS_BINDING("EMAIL_IS_BINDING","该邮箱已绑定"),
    USER_DELETE_ERROR("USER_DELETE_ERROR","用户删除失败"),
    USER_PARAMTER_MISSING("USER_PARAMTER_MISSING", "参数不能为空"),
    USER_PARAMTER_FORMAT_ERROR("USER_PARAMTER_FORMAT_ERROR", "参数格式错误"),
    USER_PASSWORD_LOGIN_IS_NOT_SUPPORTED("USER_PASSWORD_LOGIN_IS_NOT_SUPPORTED", "不支持密码方式登录"),
    USER_HAS_BEEN_AUTHENTICATED("USER_HAS_BEEN_AUTHENTICATED", "用户已实名认证"),
    USER_OBJ_ALREADY_EXISTS("USER_OBJ_ALREADY_EXISTS", "已存在"),
    USER_AUTHCODE_UNSUPPORTED_USE("USER_AUTHCODE_UNSUPPORTED_USE", "验证码不支持此用途"),
    USER_AUTHCODE_VALIDATION_ERROR("USER_AUTHCODE_VALIDATION_ERROR", "验证码验证错误"),
    USER_AUTHCODE_SPACING_IS_TOO_SHORT("USER_AUTHCODE_SPACING_IS_TOO_SHORT", "发送验证码间隔太短"),
    USER_AUTHCODE_TIME_LIMIT("USER_AUTHCODE_TIME_LIMIT", "验证码已过时效期"),
    USER_NO_SESSION("USER_NO_SESSION", "无会话信息"),
    USER_TOKEN_EXPIRED("USER_TOKEN_EXPIRED", "令牌已失效"),
    USER_UNBUNDLED_MOBILE("USER_UNBUNDLED_MOBILE", "用户未绑定手机"),


    /*===========================Departments ====================================*/
    SYS_DEPARTMENTS_NAME("SYS_DEPARTMENTS_NAME","部门已经存在"),
    SYS_DEPARTMENTS_UPDATE_ERROR("SYS_DEPARTMENTS_UPDATE_ERROR","修改失败"),
    SYS_DEPARTMENTS_ADD_ERROR("SYS_DEPARTMENTS_ADD_ERROR","新增失败"),

     /*===========================roles ====================================*/
    SYS_ROLES_ADD_ERROR("SYS_ROLES_ADD_ERROR","添加失败"),
    SYS_ROLES_UPDATE_ERROR("SYS_ROLES_UPDATE_ERROR","修改失败"),
    SYS_ROLES_DELETE_ERROR("SYS_ROLES_DELETE_ERROR","删除失败"),

     /*===========================rights ====================================*/
    SYS_RIGHTS_ERROR("SYS_RIGHTS_ERROR","权限错误"),


    /*=========================== goodsCategory ====================================*/
    SYS_GOODSCATEGORY_ADD_ERROR("SYS_GOODSCATEGORY_ADD_ERROR","添加商品品类失败"),
    SYS_GOODSCATEGORY_UPDATE_ERROR("SYS_GOODSCATEGORY_UPDATE_ERROR","修改商品品类失败"),
    SYS_GOODSCATEGORY_DELTET_ERROR("SYS_GOODSCATEGORY_DELTET_ERROR","删除商品品类失败"),
    GOODS_CODE_TYPE_ERROR("GOODS_CODE_TYPE_ERROR","商品货币类型错误"),


    /*=========================== goodsDeliverService ====================================*/
    SYS_GOOdSDELIVERSERVICE_ADD_ERROR("SYS_GOOdSDELIVERSERVICE_ADD_ERROR","添加自动发货服务失败"),
    SYS_GOOdSDELIVERSERVICE_UPDATE_ERROR("SYS_GOOdSDELIVERSERVICE_UPDATE_ERROR","修改商品品类失败"),
    SYS_GOOdSDELIVERSERVICE_DELTET_ERROR("SYS_GOOdSDELIVERSERVICE_DELTET_ERROR","删除商品品类失败"),

    /*=========================== goodsDiscounts ====================================*/
    SYS_GOOdSDISCOUTS_ADD_ERROR("SYS_GOOdSDISCOUTS_ADD_ERROR","添加商品折扣设置失败"),
    SYS_GOOdSDISCOUTS_UPDATE_ERROR("SYS_GOOdSDISCOUTS_UPDATE_ERROR","修改商品折扣设置失败"),
    SYS_GOOdSDISCOUTS_DELTET_ERROR("SYS_GOOdSDISCOUTS_DELTET_ERROR","删除商品折扣设置失败"),

    /*=========================== goodsPropertiesConfig ====================================*/
    SYS_GOOdSPROPERTIESCONFIG_ADD_ERROR("SYS_GOOdSPROPERTIESCONFIG_ADD_ERROR","添加商品或订单的扩展属性配置失败"),
    SYS_GOOdSPROPERTIESCONFIG_UPDATE_ERROR("SYS_GOOdSPROPERTIESCONFIG_UPDATE_ERROR","修改商品或订单的扩展属性配置失败"),
    SYS_GOOdSPROPERTIESCONFIG_DELTET_ERROR("SYS_GOOdSPROPERTIESCONFIG_DELTET_ERROR","删除商品或订单的扩展属性配置失败"),

    /*=========================== goodsPropertiesCroup ====================================*/
    SYS_GOOdSPROPERTIESCROUP_ADD_ERROR("SYS_GOOdSPROPERTIESCROUP_ADD_ERROR","添加商品属性分组失败"),
    SYS_GOOdSPROPERTIESCROUP_UPDATE_ERROR("SYS_GOOdSPROPERTIESCROUP_UPDATE_ERROR","修改商品属性分组失败"),
    SYS_GOOdSPROPERTIESCROUP_DELTET_ERROR("SYS_GOOdSPROPERTIESCROUP_DELTET_ERROR","删除商品属性分组失败"),


    /*=========================== goodsVersion ====================================*/
    SYS_GOOdSVERSION_ADD_ERROR("SYS_GOOdSVERSION_ADD_ERROR","添加商品历史版本失败"),
    SYS_GOOdSVERSION_UPDATE_ERROR("SYS_GOOdSVERSION_UPDATE_ERROR","修改商品历史版本失败"),
    SYS_GOOdSVERSION_DELTET_ERROR("SYS_GOOdSVERSION_DELTET_ERROR","删除商品历史版本失败"),

    /*=========================== goodsVersion ====================================*/
    SYS_CAIYOUXISDK_ADD_ERROR("SYS_CAIYOUXISDK_ADD_ERROR","添加彩游戏SDK配置失败"),
    SYS_CAIYOUXISDK_UPDATE_ERROR("SYS_CAIYOUXISDK_UPDATE_ERROR","修改彩游戏SDK配置失败"),
    SYS_CAIYOUXISDK_DELTET_ERROR("SYS_CAIYOUXISDK_DELTET_ERROR","删除彩游戏SDK配置失败");

    private String code;
    private String msg;

    private ErrorCode(String code,String msg){
        this.code = code;
        this.msg = msg;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }
}